package com.SmartCare.controller.client;

import com.SmartCare.common.Result;
import com.SmartCare.service.medicine.MedicationRecordService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/client")
@Api(tags = "C端用药提醒相关接口")
@Slf4j
public class MedicineReminderController {
    @Resource
    private MedicationRecordService medicationRecordService;

    /**
     * 根据护工id查询用药记录表中的老人名称
     */
    @GetMapping("/names")
    public Result getEldersById(Long id){
        return medicationRecordService.getEldersById(id);
    }

    /**
     * 根据老人id药单记录表中药单id
     */
    @GetMapping("/mlist")
    public Result getMIds(Long elderId,Long nurseId){
        return medicationRecordService.getMIds(elderId,nurseId);
    }

    /**
     * 查询服用时间
     */
    @PostMapping("/details")
    public Result getDetails(@RequestParam List<Long> ids){
        return medicationRecordService.getDetails(ids);
    }
}
